<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="security" uri="http://www.springframework.org/security/tags" %>
<%@ page session="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<c:set var="language" value="${param.language}" />
<c:if test="${language == null}">
<c:set var="language" value="en"/>
</c:if>
<fmt:setLocale value="${language}" />
<fmt:setBundle basename="ict.kth.se.text" />
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <!-- Meta information --> 
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <meta name="Author" content="Group 12"/>
        
        <title>Grönalund</title>
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>

        <!-- Stylesheets --> 
        <link rel="stylesheet" href=<c:url value="/resources/css/style.css"/> />
		<link href='http://fonts.googleapis.com/css?family=PT+Sans:400,700' rel='stylesheet' type='text/css'/>        
    </head>
    
    <body>
    	<%@ include file="header.jsp" %>
    	<div id="wrapper">        
            <div class="tabs">
             	<!-- tabs -->
            	<ul id="menu" class="tabNavigation">
		    		<li><a href="<c:url value="/?language=${language}"/>" title="Seeker"><label for="jobSeek"><fmt:message key="home.label.jobSeek" /></a></li>
                    <li><a href="<c:url value="/admin?language=${language}"/>" title="Login" class="active"><label for="recLogin"><fmt:message key="home.label.recLogin" /></a></li>
                    <security:authorize ifAnyGranted="ROLE_ADMIN,ROLE_RECRUITER">
                    	<li><a href="<c:url value="/j_spring_security_logout?language=${language}"/>" title="Logout"><label for="logOut"><fmt:message key="home.label.logOut" /></a></li>
                    </security:authorize>
				</ul>            
                <!-- tab containers -->
               
                <div id="content_container">
                      <div id="peer">
                            <div id="peer_wrapper">
                           	  	<div class="spacer"></div>
                            	<h1> <label for="recruiter_view"><fmt:message key="home.label.recruiter_view" /></h1>
                            	<b><label for="user"><fmt:message key="home.label.user" />: <security:authentication property="principal.username"/></b>
                            	<div id="all-seekers-list">
                            		<h2><label for="jSeekers"><fmt:message key="home.label.jSeekers" /></h2>
                            		<div id="personsContainer">                            			
                            			<c:forEach items="${allSeekers}" var="seeker">
                            				<div class="personlist"><a href="personDetails?id=${seeker.id}">${seeker.firstName} ${seeker.lastName}</a></div>
                            			</c:forEach>
                            		</div>
                            		
                            		<security:authorize ifAllGranted="ROLE_ADMIN">
                            		<h2><label for="users"><fmt:message key="home.label.users" /> </h2>
                            		<div id="personsContainer">                            			
                            			<c:forEach items="${allRecruiters}" var="recruiter">
                            				<div class="personlist"><a href="adminDetails?id=${recruiter.id}">${recruiter.firstName} ${recruiter.lastName}</a></div>
                            			</c:forEach>
                            		</div>
                            		<a href="createNewUser" class="send_link"><label for="cNewUser"><fmt:message key="home.label.cNewUser" /></a>
                            		</security:authorize>
                            	</div>                               
                            </div>                
                      </div>
                </div>
            </div>                  
    	</div>   
    </body>
</html>